package v3.chapter1.useReturnInterrupt;

public class Run {

	public static void main(String[] args) throws InterruptedException {
		MyThread t=new MyThread();
		t.start();
		Thread.sleep(2000);
		t.interrupt();

	}
}

class MyThread extends Thread {

	@Override
	public void run() {
		while (true) {
			if (this.isInterrupted()) {
				System.out.println("停止了！");
				return;
			}
			System.out.println("timer=" + System.currentTimeMillis());
		}
	}

}
